<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Admin/News/index')}">新闻列表</a></li>
			<!--<li><a href="{:U('Admin/News/pindex')}">采集新闻</a></li>-->
			<li><a href="{:U('Admin/News/add')}">添加新闻</a></li>
		</ul>
		<if condition="!empty($formParam['upperId'])">
		<h4>{$subjectName}</h4>
		</if>
		<form class="well form-search" id="query_form" method="post" action="{:U('Admin/News/index')}">
			新闻标题： 
			<input type="text" name="newsTitle" style="width: 120px;" value="{$formParam.newsTitle}" placeholder="新闻标题...">
			<!-- 新闻分类：
			<select class="select_2" name="cateType" style="width: 90px;">
				<option value=''>全部</option>
				<foreach name="types" item="vo">
					<option value="{$vo.typeId}" <if condition="$formParam.typeId eq $vo.typeId"> selected </if>>{$vo.name}</option>
				</foreach>
			</select> -->
			是否原创：
			<select class="select_2" name="isOriginal" style="width: 90px;">
				<option value='-1' <if condition="$formParam.isOriginal eq ''"> selected </if>>全部</option>
				<option value='0' <if condition="$formParam.isOriginal eq 0"> selected </if>>是</option>
				<option value='1' <if condition="$formParam.isOriginal eq 1"> selected </if>>否</option>
			</select>
			<!-- 审核状态： 
			<select class="select_2" name="isAudit" style="width: 90px;">
				<option value='-1' <if condition="$formParam.isAudit eq ''"> selected </if>>全部</option>
				<option value='0' <if condition="$formParam.isAudit eq 0"> selected </if>>未审核</option>
				<option value='1' <if condition="$formParam.isAudit eq 1"> selected </if>>审核通过</option>
				<option value='2' <if condition="$formParam.isAudit eq 1"> selected </if>>审核未通过</option>
			</select> -->
			状态：
			<select class="select_2" name="status" style="width: 90px;">
				<option value='0' <if condition="$formParam.status eq 0"> selected </if>>启用</option>
				<option value='1' <if condition="$formParam.status eq 1"> selected </if>>禁用</option>
			</select>
			<input type="button" name="query_form_btn" id="queryBtn" data-action="{:U('Admin/News/index')}" class="btn btn-primary" value="查询" />
		</form>
		<form class="js-ajax-form" action="" method="post">
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th>新闻名称</th>
					<th>新闻分类</th>
					<th>所属专题</th>
					<!-- <th>采集新闻</th>
					<th>人工新闻</th> -->
					<th>原创</th>
					<th>发布时间</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="data" item="vo">
				<tr>
					<td><a href='{:U("Admin/News/detail",array("newsId"=>number_format($vo["newsId"],0,'','')))}'>{$vo.newsTitle}</a></td>
					<td>{$vo.category.cateName}</td>
					<td>{$vo.ncPo.cateName}</td>
					<td><if condition="$vo.isOriginal eq 1">否<else/>是</if></td>
					<td>{$vo['createTime']}</td>
					<td>
						<a href='{:U("Admin/News/detail",array("newsId"=>number_format($vo["newsId"],0,'','')))}'>查看</a>
						<a href='{:U("Admin/News/edit",array("newsId"=>number_format($vo["newsId"],0,'','')))}'>编辑</a>
						<eq name="vo.status" value="1">
							<a href='{:U("Admin/News/del",array("newsId"=>number_format($vo["newsId"],0,'',''),"status"=>0))}' class="js-ajax-dialog-btn" data-msg="确定启用吗？">启用</a>
							<else/>
							<a href='{:U("Admin/News/del",array("newsId"=>number_format($vo["newsId"],0,'',''),"status"=>1))}' class="js-ajax-dialog-btn" data-msg="确定禁用吗？">禁用</a>
						</eq>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		</form>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
	$(document).ready(function(){
		$('input[name="query_form_btn"]').click(function(){
			 $('#query_form').attr('action', $(this).attr('data-action'));
			 $('#query_form').submit();
		});
		
	});
	</script>
</body>
</html>